<?php 
// +----------------------------------------------------------------------
// | RXThinkCMF框架 [ RXThinkCMF ]
// +----------------------------------------------------------------------
// | 版权所有 2017~2020 南京RXThinkCMF研发中心
// +----------------------------------------------------------------------
// | 官方网站: http://www.rxthink.cn
// +----------------------------------------------------------------------
// | Author: 牧羊人 <1175401194@qq.com>
// +----------------------------------------------------------------------

namespace app\admin\model;


use app\common\model\BaseModel;

/**
 * 专利监控-模型
 * @author 牧羊人
 * @since: 2022/01/07
 * Class OfPatentMonitor
 * @package app\admin\model
 */
class OfPatentMonitor extends BaseModel
{
    // 设置数据表名
    protected $name = "of_patent_monitor";

    /**
     * 获取缓存信息
     * @param int $id 记录ID
     * @return \app\common\model\数据信息|mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @author 牧羊人
     * @since: 2022/01/07
     */
    public function getInfo($id)
    {
        $info = parent::getInfo($id); // TODO: Change the autogenerated stub
        if ($info) {
            $info['apply_time_str'] = $info['apply_time']>0?date("Y-m-d",$info['apply_time']):'';
            $info['issue_time_str'] = $info['issue_time']>0?date("Y-m-d",$info['issue_time']):'';
            $info['pay_time_str'] = date("Y-m-d",strtotime("+".($info['year']-1)." year",$info['apply_time']));
            $info['end_time_str'] = date("Y-m-d",strtotime("+".$info['year']." year",$info['apply_time']));
            $info['notice_time_str'] = $info['notice_time']>0?date("Y-m-d",$info['notice_time']):'';                                                                                                                   
        }
        return $info;
    }
}